Skip to content

Phase 7.1: vendor Test262, WPT, WebIDL, Unicode and TodoMVC - #176

Open
atiernan wants to merge 23 commits into
mainfrom
claude/js-jit-compiler-next-21ddc8
Open

atiernan wants to merge 23 commits into
mainfrom
claude/js-jit-compiler-next-21ddc8

Conversation

@atiernan

Copy link
Copy Markdown
Member

Phase 7 item 7.1, inventory and test data: the suites and pins the JavaScript work tests against. There is no engine code yet.

This branch also carries the Phase 7 and JIT plan commits from claude/js-jit-compiler-xzbjyc, which were not on main yet. Those commits only touch docs/phases/phase-7.md, docs/phases/jit.md and docs/ROADMAP.md.

New crates

All four are empty, at tier 0, and placed in PLACES (Renderer). Their target tiers follow phase-7.md's Crates table:

Crate Target tier Holds
clazel-js-lexer 2 Test262
clazel-js-regexp 1 Unicode data
clazel-web 0 WPT, TodoMVC
clazel-webidl 0 WebIDL

Vendored data

Each suite has a SOURCE.md and a licence file, and goes through cargo xtask testdata.

  • ECMA-262: pinned at ES2026, commit 0248456c, in crates/clazel-js-lexer/SPEC-PIN.md. The text is not vendored, because nothing reads it yet.
  • Test262: pinned at e91219cb, its last commit before that spec commit.
    • The parser subset: negative parse/early/resolution tests, the lexical directories, their fixtures, harness/ and features.txt. That is 5,212 tests, 8.3 MB.
    • The converter reads each test's front matter. A feature excluded by 7.0(b), or newer than the edition, makes the test an expected failure with that reason (263 tests).
    • The rest of Test262 joins with items 7.7 to 7.11.
  • WPT: pinned at 10dd48f8, the newest WPT commit the repo already uses. It holds the directories in exit criterion 2 plus testharness.js, 2,229 files.
  • WebIDL: taken from w3c/webref at 1c0592d0. It covers DOM, HTML, Fetch, XHR, URL, Storage, UI Events and CSSOM.
  • Unicode 18.0: the files RegExp needs, each pinned by SHA-256. The converter checks that UnicodeData.txt and DerivedNormalizationProps.txt are identical to clazel-idna's copies.
  • TodoMVC: pinned at ff43b02e. It has the vanilla (javascript-es6), React and Vue versions, with the MIT licence.

For WPT, WebIDL, Unicode and TodoMVC, the generated tables only list each file's path, size and SHA-256 for now. The items that use them will add real converters.

xtask changes to review

  • testdata.rs now accepts tree suites (TREE_SUITES) and SHA-256: <hash> <file> lines in SOURCE.md.
  • inventory.rs (new) writes the path, size and SHA-256 tables.
  • test262.rs (new) has a hand-written front-matter reader.

Deferred, on purpose

  • Boa and the other engines: not added. Each would bring many new rows in docs/DEPENDENCIES.md, and nothing uses them before 7.3.
  • The pass baseline: not recorded, since no engine exists yet to run the tests.
  • IDL from other specs: files the vendored IDL refers to (webidl, hr-time, streams, FileAPI) are left for 7.12.
  • WPT helpers: the support files the tests load (/common/*, idlharness.js, testharnessreport.js) are left for 7.15.

Verification

  • Run locally on Windows and passing:
    • cargo xtask testdata: TEST DATA UP TO DATE
    • cargo xtask check: STATIC CHECKS PASSED
    • cargo test -p xtask (123 passed) and the four new crates (no tests yet)
    • cargo clippy on xtask and the new crates: clean
  • cargo xtask verify --changed was not run. The new crates change Cargo.lock, which would make it re-check every crate. CI's full verification is the check, and its proof jobs need approval from a reviewer of the full-verification environment.

🤖 Generated with Claude Code

claude and others added 20 commits November 16, 2026 01:45
Adds docs/phases/phase-9.md and moves JIT compilation from the roadmap's
non-goals to a proposed Phase 9. Safety comes from a tier 2 validator over
an A64 spec; correctness from per-op refinement of Phase 7's bytecode
semantics. The IR, back end, validator and enter stub carry no JS types,
so a WebAssembly front end can reuse them. Item 9.0's decisions, including
a change to CLAUDE.md rule 1 for entering generated code, are open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016HKpuQzkKjH3XJ2ihASPMg
The baseline JIT becomes Phase 7's main path, with a thin interpreter
loop over the shared op handlers. Targets Windows x86-64, Linux x86-64
and macOS arm64: clazel-x64 joins clazel-a64, with one validator theorem
proven per instruction set. No indirect branches means x86-64 needs no
NaCl-style bundles. On Windows and Linux the renderer never makes memory
executable itself (decision J.0(b), option C2), so Arbitrary Code Guard
stays on. The plan moves from phase-9.md to jit.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016HKpuQzkKjH3XJ2ihASPMg
…lidator

The maintainer took every J.0 recommendation (E1, C2, G1, SSE2 only).
The rule 1 change lands with J.7's code, not before. Batching compiled
functions to the code process becomes a design requirement, and J.6 and
J.11 gain the validator benchmark and the break-even measurement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016HKpuQzkKjH3XJ2ihASPMg
Adds docs/phases/phase-7.md: the lexer and JSON at tier 2, the parser,
RegExp, number conversions and heap at tier 1, the bytecode semantics as
the Verus spec the JIT refines, built-ins and bindings at tier 0 with
Test262 and WPT as evidence. The kernel gains script fetches, fetch() and
XHR with CORS and ORB, same-origin URL updates and input-gated popups,
each with a theorem. Fixes the shapes jit.md's J.1 asks for, and retires
the Phase 2 line-script format. Item 7.0's decisions are open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016HKpuQzkKjH3XJ2ihASPMg
Every recommendation is taken, each weighed against the roadmap's goals:
the lexer and JSON at tier 2, the rest of the syntax at tier 1; the
stated language scope; S1, keeping cookie noninterference as proven; no
frames until 5.24's kernel design is built; no workers; a non-moving
mark-and-sweep collector at tier 1; the host ends a stuck renderer on
the user's word. The Wikipedia fixture is written here rather than
vendored, to keep CC BY-SA text out of the MIT repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016HKpuQzkKjH3XJ2ihASPMg
An empty lib at tier 0, target tier 2, placed in the Renderer component.
It holds the test data of item 7.1; the lexer's contracts come first, in
item 7.2.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A hand-written reader of each test's frontmatter (flags, features,
includes, negative) that emits a Rust table, with the tests outside
7.0(b)'s scope or newer than the edition as expected failures and the
reason. The data is not vendored yet: see the pin file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The spec text is not vendored (nothing reads it). Test262's data is held
back: its scope is about 63 MB, over the 40 MB limit; the pin file has the
measurements and a proposed 8.7 MB subset.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Parse, early and resolution negative tests of test/language and its lexical
directories, their fixtures, harness/ and features.txt: 5,422 files, 8.7 MB.
Stored without line-ending conversion.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The first copy was made from a Windows checkout that converted line endings,
so every file differed from upstream. This one is read from the git objects at
e91219cb, and the table's tree hash is regenerated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The engine crates depend on no browser crate, and the browser reaches the engine only through clazel-js's public API. A Host trait carries ECMA-262's host hooks, plus the clock, time zone, randomness and locale. A second embedder, clazel-js-shell, runs Test262 through that API. A Runtime is Send with no global state. A Terminator stops a script in-process, which brings 7.0(g)'s interrupt check forward. The JIT asks a CodeMapper, so J.0(b)'s C2 is the browser's choice. The plan also states what it does not promise: Node itself is not a drop-in target, and the C API, SharedArrayBuffer across threads and a stable API are Phase 8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cess

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atiernan
atiernan temporarily deployed to full-verification November 16, 2026 23:14 — with GitHub Actions Inactive
@atiernan
atiernan added this pull request to stack #188 November 17, 2026 13:11

This branch is being deployed

1 queued deployment
full-verification — 0fc25585 Deployed Nov 20, 2026 by atiernan via Approve the proofs #621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants